<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['ischecklogin']=model('core/core')->checklogin('','',true);
	$_SESSION['memberid']=$this->model('member')->checkmember();
	$signlogid=$_RQ['id'];
	$signlog=pdo_get('jy_aihire_signlog',array('uniacid'=>$_SESSION['uniacid'],'id'=>$signlogid));
	$gong=pdo_get('jy_aihire_gong',array('uniacid'=>$_SESSION['uniacid'],'id'=>$signlog['gongid']));
	$gong['jobinfo']=json_decode($gong['jobinfo'],true);
	$gong['onlinetime']=json_decode($gong['onlinetime'],true);
	$gong['baotypetitle']=$this->job_paytype2[$job['paytype']].'结('.$this->job_baotype[$job['baotype']].'版)';
	$gong['merchname']=pdo_getcolumn('jy_aihire_merch',array('uniacid'=>$_SESSION['uniacid'],'id'=>$gong['merchid']),'title');
	$gong['statustitle']=$this->gong_status[$gong['status']];
	$gong['typetitle']=$this->job_type[$gong['jobinfo']['type']];
	$gong['paytypetitle']=$this->job_paytype[$gong['jobinfo']['paytype']];
	$return['gong']=$gong;
	$return['signlog']=$signlog;
	if($signlog['memberid']==$_SESSION['memberid']){
		$return['ismy']=1;
	}
	$return['pcd']=$this->session('pcd')?:array('city'=>'');
	$return['list']=$list;
	set_html('title','我的工作轨迹');
	exi($return);
}
if($_RQ['op']=='getlist'){
	$signlogid=$_RQ['signlogid'];
	$params=array('uniacid'=>$_SESSION['uniacid'],'signid'=>$signlogid);
	if(isset($_RQ['status'])){
		$params['status']=intval($_RQ['status']);
		$return['status']=$_RQ['status'];
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 500;
	$list=pdo_getslice('jy_aihire_maplog',$params,array($pindex,$psize),$total,$fields,'','id desc');	
	if($list){
		foreach($list as &$item){
			$item['lat_lng']=json_decode($item['lat_lng'],true);
			$item['createtime']=date('Y-m-d H:i:s', $item['createtime']);
		}
	}
	$return['list']=$list;
	exi($return);
}
if($_RQ['op']=='upmaplog'){
	$post=get_postdata();
	$signlogid=intval($_RQ['signlogid']);
	$signlog=pdo_get('jy_aihire_signlog',array('id'=>$signlogid,'uniacid'=>$_SESSION['uniacid']));
	$this->model('job')->upmaplog($signlog,$post);
	exi('更新成功！');
}